Stochastic dynamic programming